package com.tul.exercise.base.string.regex;

import org.junit.jupiter.api.Test;

import static  com.tul.exercise.base.utils.Print.*;
/**
 * @Description 《java编程思想》第13章 示例10：
 * <p>
 * replace的正则匹配功能
 **/
public class Replacing {
    static String s = Splitting.str;

    @Test
    public void test() {
        print(s.replaceFirst("f\\W+", "XXXXXXX"));
        print(s.replaceAll("shrubbery|tree|herring","YYYYYYYY"));

    }

    @Test
    public void test2() {
        String sentense = "Atend aljglsajg ajgljgsalg .";

        String regex = "[A-Z]*.";
        print(sentense.matches(regex));
    }


}
